package com.rest.common.utils;

import org.springframework.stereotype.Component;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;

@Component
public class NativeQueryUtils {
    @PersistenceContext
    private EntityManager entityManager;

    public List queryListObjectMapBySql(String sql){
        Query query = entityManager.createNativeQuery(sql);
        return query.getResultList();
    }

}
